<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <title>项目接口</title>
    <th:block th:include="import :: links"></th:block>
    <link th:href="@{/plugins/ztree/css/zTreeStyle/zTreeStyle.css}" rel="stylesheet"/>
    <link th:href="@{/plugins/ztree/css/metroStyle/metroStyle.css}" rel="stylesheet"/>
    <link th:href="@{/css/common.css}" rel="stylesheet"/>
</head>
<body>
<header>
    <th:block th:include="import :: navigation"></th:block>
</header>
<div class="container" style="margin-top: 60px;">
    <div class="jumbotron col-md-12">
        <h3 th:text="${bean.appName}">Hello, world!</h3>
    </div>
    <div class="col-md-12" style="padding: 0px;">
        <div class="panel panel-primary" style="margin: 0px;height: 100%;background: transparent;">
            <div class="panel-heading">当前版本</div>
            <div class="panel-body" style="padding: 0px 0px;">
                <div class="col-md-6" style="border-right: 1px solid #ccc;">
                    <div class="alert alert-info">当前版本接口列表</div>
                    <ul id="moduleTree" class="ztree" style="min-height: 300px;"></ul>
                </div>
                <div class="col-md-6">
                    <div class="alert alert-danger">未纳入版本的列表</div>
                    <ul id="noPublishTree" class="ztree" style="min-height: 300px;"></ul>
                </div>
                <div class="alert alert-success col-md-12" style="margin: 0px;">请勾选未纳入版本的接口定义，点击加入到当前版本，并形成一个最新的版本</div>
            </div>
            <div class="panel-footer text-center">
                <form id="publishForm" style="display: none;" method="post" action="/project/publish">
                    <input type="hidden" name="appId" th:value="${bean.appId}"/>
                </form>
                <button type="button" onclick="publishVersion()" class="btn btn-success" form="publishForm">合并为最新版本</button>
            </div>
        </div>
    </div>
</div>
<footer id="footer"></footer>
<th:block th:include="import :: impJS"></th:block>
<script th:src="@{/plugins/ztree/js/jquery.ztree.all.min.js}" type="text/javascript"></script>
<script th:inline="javascript">
    var appId = [[${bean.appId}]];
    var appVerson = [[${bean.appProdVersion}]]
</script>
<script type="text/javascript" th:src="@{/js/project/publish.js}"></script>
</body>
</html>